<?php
require('../vendor/autoload.php');

use BitWasp\Bitcoin\Mnemonic\MnemonicFactory;
use BitWasp\Bitcoin\Key\Deterministic\HierarchicalKeyFactory;

$mnemonic = file_get_contents('./wallet/mnemonic');
$bip39 = MnemonicFactory::bip39();
$entropy = $bip39->mnemonicToEntropy($mnemonic);
$masterKey = HierarchicalKeyFactory::fromEntropy($entropy);

for($i=0;$i<3;$i++){
  $key = $masterKey->deriveChild($i);
  echo 'private key '. $i . ' => ' . $key->getPrivateKey()->getHex() . PHP_EOL;
}

